#define  _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main() {
    int n = 0;
    int count = 0;
    int sum = 0;
    scanf("%d", &n);
    for (int i = 2; i <= n; i++)
    {
        for (int j = 2; j <= i / 2; j++)
        {
            if (0 == i % j)
            {
                sum += j;
            }
            if (sum == i)
            {
                count++;
            }
        }
    }
    printf("%d", count);
    return 0;
}